import { FormItemProps } from 'antd'

export const enum FormItemType {
  'Input' = '0',
  'Select' = '1',
  'Cascader' = '2',
  'TreeSelect' = 3,
  'DSelect',
  'SelectWithAll',
  'RadioGroup',
  'CheckboxGroup',
  'Checkbox',
  'TimePicker',
  'DatePicker',
  'RangePicker',
  'Switch',
  'TextArea',
  'InputNumber',
  'Password',
  'Upload',
  'CodeMirror'
}

export interface SelectOption {
  label: string
  value: unknown
}

export interface FormItemConfig {
  label: string
  field: string
  type: keyof typeof FormItemType
  required?: boolean
  options?: SelectOption[]
}

export interface FormItem {
  type?: keyof typeof FormItemType
  formItemProps?: FormItemProps
  props?: any // 所有表单控件的props的集合
  render?: () => JSX.Element
  span?: any
}
